<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #overlay{
            background: rgba(0, 0, 0, 0.6);
            width: 100%;
            margin: auto;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
        #center{
            background: #fff;
            border-radius: 5px;
            padding-top: 15px;
            padding-left: 30px;
            padding-bottom:15px;
            width: 300px;
            height: 170px;
            position: fixed;
            margin: auto;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
        }
    </style>
</head>
<body>
    <!-- <div id="box">
        <button @click="show=true" >Click</button>
        <div id="overlay" v-show="show" @click="show=false">
            <div id="center" @click.stop>
                <div>用户：<input type="text" /></div>
                <div>密码：<input type="password" /></div>
                <div><button>登录</button></div>
            </div>
        </div>
    </div> -->
    <div id="box">
        <button @click="show=true" >Click</button>
        <div id="overlay" v-show="show" @click.self="show=false">
            <div id="center">
                <div>用户：<input type="text" /></div>
                <div>密码：<input type="password" /></div>
                <div><button @click.self="show=false">登录</button></div>
            </div>
        </div>
    </div>
    <script src="./vue2.js"></script>
    <script>
        new Vue({
            el:'#box',
            data:{
                show:false,
            },
            methods:{
                handleClick(){}
            }
        })
    </script>
</body>
</html>